package com.beta.user.auth.center.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.beta.user.auth.center.service.mapper.SelfappAuthAccountMapper;
import com.beta.user.auth.center.service.mapper.model.SelfappAuthAccount;
import com.beta.user.auth.center.service.service.ISelfappAuthAccService;
import org.springframework.stereotype.Service;

/**
 * @author gwqin
 * @description
 * @date 2023-06-29 17:21
 */
@Service
public class SelfappAuthAccServiceImpl extends ServiceImpl<SelfappAuthAccountMapper, SelfappAuthAccount>  implements ISelfappAuthAccService {

    @Override
    public void insertIgnore(SelfappAuthAccount account) {
        SelfappAuthAccount selfappAuthAccount = getBaseMapper().selectOne(new LambdaQueryWrapper<SelfappAuthAccount>().eq(SelfappAuthAccount::getAppId,account.getAppId()).eq(SelfappAuthAccount::getUserId,account.getUserId()));
        if(null == selfappAuthAccount){
            getBaseMapper().insert(account);
        }
    }

}
